IF OBJECT_ID('ssf.gbl_exists_variable') IS NOT NULL
	DROP FUNCTION ssf.gbl_exists_variable
GO

CREATE FUNCTION ssf.gbl_exists_variable (
	@variable_name NVARCHAR(128)
)
RETURNS BIT
AS
BEGIN
	IF EXISTS (
		SELECT variable_id
		FROM ssf.gbl_variable WITH (NOLOCK)
		WHERE variable_name = @variable_name
	)
		RETURN 1
	
	RETURN 0
END
GO
